package com.sikaryofficial.backend.domain.dto.req;

import com.sikaryofficial.common.core.valid.ConditionalLength;
import com.sikaryofficial.common.core.valid.PostCodeValid;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;

/**
 * 我的地址对象 address_user_t
 *
 * @author qinjinyuan
 * @date 2023-11-16
 */
@Getter
@Setter
@ToString
@ApiModel(value = "收货地址请求入参", description = "收货地址请求入参")
public class AddressUserReq {

    /**
     * 我的地址ID
     */
    @ApiModelProperty(value = "我的地址ID")
    private Long userAddressId;

    /**
     * 地址ID
     */
    @ApiModelProperty(value = "地址ID")
    private Long addressId;

    /**
     * 名字
     */
    @ApiModelProperty(value = "名字")
    @Length(min = 1, max = 20, message = "firstName could not less than 1 and greater than 20")
    private String firstName;

    /**
     * 姓
     */
    @ApiModelProperty(value = "姓")
    @Length(min = 1, max = 20, message = "lastName could not less than 1 and greater than 20")
    private String lastName;

    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号")
    @ConditionalLength(max = 20, message = "phoneNumber could not less than 1 and greater than 20")
    private String phoneNumber;

    /**
     * 地址详情
     */
    @ApiModelProperty(value = "地址详情")
    @ConditionalLength(message = "addressDetail could not less than 1 and greater than 100")
    private String addressDetail;

    /**
     * 默认地址：0-默认 1-非默认
     */
    @ApiModelProperty(value = "默认地址：0-默认 1-非默认", example = "0")
    private Integer addressDefault;

    /**
     * 经度
     */
    @ApiModelProperty(value = "经度")
    private String longitude;

    /**
     * 纬度
     */
    @ApiModelProperty(value = "纬度")
    private String latitude;

    /**
     * 国家
     */
    @ApiModelProperty(value = "国家")
    private String country;

    /**
     * 区域
     */
    @ApiModelProperty(value = "区域")
    private String area;

    /**
     * 城市
     */
    @ApiModelProperty(value = "城市")
    private String city;

    /**
     * 区县
     */
    @ApiModelProperty(value = "区县")
    private String county;

    /**
     * 邮编(可选)
     */
    @ApiModelProperty(value = "邮编(可选)")
    @PostCodeValid(message = "Post code must be letters | numbers | blank space")
    @ConditionalLength(max = 20, message = "postCode could not greater than 20")
    private String postCode;

    /**
     * 支付账号
     */
    @ApiModelProperty(value = "支付账号", example = "0")
    @ConditionalLength(message = "paymentAccount could not greater than 100")
    private String paymentAccount;

    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱", example = "xxx@126.com")
    @Email(regexp = "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}$", message = "emailAddress is not valid")
    private String email;

    @ApiModelProperty(value = "是否是支付账号 0-否 1-是，默认0-否", example = "0")
    private int hasPayment;
}
